﻿@using Webdiyer.WebControls.Mvc
@model PagedList<Dyd.BaseService.ConfigManager.Domain.Model.tb_log_model>
@{
    ViewBag.Title = "常用日志";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@Html.AntiForgeryToken()
<div class="head">
    <div class="title">
        @ViewBag.Title
    </div>
</div>
<div class="orderlist m10 myorder">
    @using (Html.BeginForm("LogIndex", "Log", FormMethod.Get, new RouteValueDictionary { { "id", "searchForm" } }))
    {
        <div class="search">

            <label>时间</label><input type="text" class="text midtext" style="width:150px;" onclick="WdatePicker()" name=" starttime" value="@ViewBag.startTime.ToString("yyyy-MM-dd")" />
            -<input type="text" class="text midtext" style="width:150px;" name="endTime" onclick="WdatePicker()" value="@ViewBag.endTime.ToString("yyyy-MM-dd")" />

            <label>项目</label><input type="text" class="text midtext" style="width:150px;" name="projectname" value="@ViewBag.projectname" />

            <label>详细信息</label><input type="text" class="text midtext" style="width:200px;" name="info" value="@ViewBag.info" />

            <input type="submit" class="btn1" value="搜索" accesskey="S" />
            <input id="clear" type="button" class="btn1" value="清空" />
        </div>
    }
    <div class="tab_cont">
        <div class="List">
            @Html.Partial("_LogIndex", Model)
        </div>
    </div>
</div>
@section Scripts{
    <script>
        $(function () {
            $("body").on("click", "#clear", function (e) {
                var id = $(this).parent().parent().attr("data-id");
                var url = "/Log/LogClear";
                if (window.confirm("确定要删除吗？")) {
                    $.post(url, addAntiForgeryToken({ id: "" }), function (data) {
                        if (data.Flag) {
                            alert(data.Message);
                            window.location.reload();
                        }
                        else {
                            alert(data.Message);
                        }
                    }, "json");
                }
            });
        });

    </script>
}
